<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>v-for循环</title>
  </head>
  <body>
    <div id="app">
      <p v-for="(item,index) in list">{{ item.id }}--{{ item.name }}---{{ index }}</p>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
      var vm = new Vue({
        el: "#app",
        data: {
          list: [
            { id: 1, name: "xingmi1" },
            { id: 2, name: "xingmi2" },
            { id: 3, name: "xingmi3" },
            { id: 4, name: "xingmi4" }
          ]
        }
      });
    </script>
  </body>
</html>
